<template>
<view class="my-main tab-view">
	<status-navigator-wrap>
		<view class="page-title">我的</view>
	</status-navigator-wrap>
	
	<view class="container">
		<view class="user-info" @click="$index.loginPopup.show = true">
			<image class="head-picture" src="@/static/images/a.jpg"></image>
			<view class="nickname-phone">
				<view>用户昵称</view>
				<view>15656565553</view>
			</view>
			<image class="edit-btn btn" src="@/static/images/icon/edit.png"></image>
		</view>
		
		<view class="amount-info">
			<view class="item">
				<view class="num">2323</view>
				<view class="label">我的关注</view>
			</view>
			<view class="item">
				<view class="num">2323</view>
				<view class="label">关注话题</view>
			</view>
			<view class="item">
				<view class="num">2323</view>
				<view class="label">我的收藏</view>
			</view>
			<view class="item">
				<view class="num">2323</view>
				<view class="label">咨询记录</view>
			</view>
		</view>
		
		<view class="pets-wrap">
			<view class="my-pet-list" v-if="petList.length != 0">
				<view class="my-pet-header">
					<text class="label">我的宠物</text>
					<view class="add-btn btn" @click="$router.to('add_pet')">
						<image src="@/static/images/icon/add.png"></image>
						<text>新增</text>
					</view>
				</view>
				<view class="pet-list">
					<view class="pet-item" v-for="item in petList">
						<view class="info">
							<view>金毛</view>
							<view>
								<text>男</text>
								<view class="separate"></view>
								<text>7岁</text>
							</view>
							<view>相当于人类8岁</view>
						</view>
						<image class="pet-piture" src="@/static/images/a.jpg" mode="heightFix"></image>
					</view>
				</view>
			</view>
			<view class="empty-add-btn fade-btn" v-else
			 @click="$router.to('add_pet'); petList.push(1)">
				<view class="add-icon">
					<image src="@/static/images/icon/add-orange.png"/>
				</view>
				<text class="label">添加你的爱宠</text>
			</view>
		</view>
		
		<view class="menu-list">
			<view class="item">
				<image class="icon" src="@/static/images/icon/history.png"></image>
				<view class="label">近期浏览</view>
				<view class="right">
					<text class="extend">23</text>
					<image src="@/static/images/icon/arrow-right.png"></image>
				</view>
			</view>
			<view class="item">
				<image class="icon" src="@/static/images/icon/user.png"></image>
				<view class="label">用户中心</view>
				<view class="right">
					<image src="@/static/images/icon/arrow-right.png"></image>
				</view>
			</view>
			<view class="item">
				<image class="icon" src="@/static/images/icon/question.png"></image>
				<view class="label">帮助中心</view>
				<view class="right">
					<image src="@/static/images/icon/arrow-right.png"></image>
				</view>
			</view>
			<view class="item">
				<image class="icon" src="@/static/images/icon/info.png"></image>
				<view class="label">关于我们</view>
				<view class="right">
					<image src="@/static/images/icon/arrow-right.png"></image>
				</view>
			</view>
		</view>
	</view>
	
</view>
</template>

<script>
import statusNavigatorWrap from '@/components/status-navigator-wrap.vue'
export default {
	data() {
		return {
			// 宠物列表
			petList: []
		}
	},
	computed: {
		
	},
	methods: {
		
	},
	components: {
		statusNavigatorWrap
	}
}
</script>

<style lang="less">
.my-main {
	display: flex;
	flex-direction: column;
	padding: 0 36rpx 20rpx;
	
	.page-title {
		display: flex;
		align-items: center;
		height: 100%;
		font-size: 48rpx;
	}
	
	.container {
		margin-top: 20rpx;
		flex: 1;
		height: 0;
		overflow-y: auto;
		padding: 0 4rpx;
		
		.user-info {
			margin-top: 34rpx;
			display: flex;
			align-items: center;
			
			.head-picture {
				width: 140rpx;
				height: 140rpx;
				border-radius: 100%;
			}
			
			.nickname-phone {
				margin-left: 24rpx;
				flex: 1;
				
				>view {
					&:nth-child(1) {
						font-size: 34rpx;
						font-weight: bold;
						color: #000000;
					}
					
					
					&:nth-child(2) {
						margin-top: 10rpx;
						font-size: 24rpx;
						color: rgba(0, 0, 0, 0.4);
					}
				}
			}
			
			.edit-btn {
				width: 32rpx;
				height: 32rpx;
			}
		}
		
		.amount-info {
			margin-top: 55rpx;
			display: flex;
			justify-content: space-between;
			
			
			.item {
				position: relative;
				display: flex;
				flex-direction: column;
				justify-content: flex-end;
				align-items: center;
				position: relative;
				height: 94rpx;
				
				.num {
					position: absolute;
					top: 0;
					font-weight: 900;
					font-size: 40rpx;
				}
				
				.label {
					font-size: 26rpx;
					color: rgba(0, 0, 0, 0.4);
				}
			}
		}
		
		.pets-wrap {
			margin-top: 55rpx;
			
			.empty-add-btn {
				height: 251rpx;
				border-radius: 20rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				padding-top: 50rpx;
				background: #F9F9F9;
				
				.add-icon {
					width: 96rpx;
					height: 96rpx;
					border-radius: 100%;
					display: flex;
					justify-content: center;
					align-items: center;
					background: #FFFFFF;
					border: 1rpx solid #E5E5E5;
					
					>image {
						width: 28rpx;
						height: 28rpx;
					}
				}
				
				.label {
					margin-top: 24rpx;
					font-size: 24rpx;
					color: #99A3B2;
				}
			}
			
			.my-pet-list {
				.my-pet-header {
					display: flex;
					justify-content: space-between;
					align-items: center;
					
					.label {
						display: flex;
						font-size: 34rpx;
						color: #292929;
					}
					
					.add-btn {
						display: flex;
						align-items: center;
						justify-content: center;
						width: 120rpx;
						height: 56rpx;
						border-radius: 8rpx;
						background: #FF6D03;
						
						>image {
							width: 18rpx;
							height: 18rpx;
						}
						
						>text {
							margin-left: 8rpx;
							font-size: 24rpx;
							line-height: 1;
							color: #F8F8F8;
						}
					}
				}
				
				.pet-list {
					margin-top: 30rpx;
					
					.pet-item {
						position: relative;
						height: 251rpx;
						border-radius: 36rpx;
						padding: 60rpx 36rpx 0;
						overflow: hidden;
						background: #F0EDF4;
						
						&:nth-child(n+2) {
							margin-top: 30rpx;
						}
						
						.info {
							>view {
								&:nth-child(1) {
									font-size: 36rpx;
									font-weight: bold;
									color: #3D3D3D;
								}
								
								&:nth-child(n+2) {
									display: flex;
									align-items: center;
									margin-top: 12rpx;
									font-size: 24rpx;
									color: #3D3D3D;
									
									.separate {
										background: #D8D8D8;
										width: 1rpx;
										height: 16rpx;
										margin: 0 18rpx;
									}
								}
							}
						}
						
						.pet-piture {
							position: absolute;
							right: 0;
							top: 0;
							height: 100%;
							transform: translateX(50%);
						}
					}
				}
			}
		}
		
		.menu-list {
			margin-top: 18rpx;
			
			.item {
				display: flex;
				align-items: center;
				height: 104rpx;
				
				.icon {
					width: 38rpx;
					height: 38rpx;
				}
				
				.label {
					flex: 1;
					margin-left: 20rpx;
					font-size: 32rpx;
					color: #000000;
					line-height: 1;
				}
				
				.right {
					.extend {
						margin-right: 18rpx;
						font-size: 26rpx;
						color: rgba(0, 0, 0, 0.25);
					}
					
					>image {
						width: 13rpx;
						height: 23rpx;
					}
				}
			}
		}
	}
}
</style>
